package com.appcheck.recording.handler.impl;

import com.appcheck.recording.ListenerManager;
import com.appcheck.recording.action.impl.ClickAction;
import com.appcheck.recording.action.impl.DateChangedAction;
import com.appcheck.recording.action.impl.ItemClickAction;
import com.appcheck.recording.action.impl.KeyAction;
import com.appcheck.recording.action.impl.OrientationChangeAction;
import com.appcheck.recording.action.impl.TextChangedAction;
import com.appcheck.recording.action.impl.TimeChangedAction;
import com.appcheck.recording.action.impl.TouchAction;

public class OneToOneGrouper extends Grouper{
	
	public OneToOneGrouper(Grouper paramGrouper){
		super(null);
	}

	@Override
	public boolean visit(ClickAction clickAction) {
		// TODO Auto-generated method stub
		forwardActionToPlugin(clickAction);
		ListenerManager.getListenerManager().setFlagTrue();
		return true;
	}

	@Override
	public boolean visit(DateChangedAction dataChangedAction) {
		// TODO Auto-generated method stub
		forwardActionToPlugin(dataChangedAction);
		return true;
	}

	@Override
	public boolean visit(TouchAction touchAction) {
		// TODO Auto-generated method stub
	    return true;
	}

	@Override
	public boolean visit(ItemClickAction itemClickAction) {
		// TODO Auto-generated method stub
		forwardActionToPlugin(itemClickAction);
		ListenerManager.getListenerManager().setFlagTrue();
		return true;
	}

	@Override
	public boolean visit(KeyAction keyAction) {
		// TODO Auto-generated method stub
		forwardActionToPlugin(keyAction);
		return true;
	}

	@Override
	public boolean visit(TextChangedAction textChangedAction) {
		// TODO Auto-generated method stub
		return super.visit(textChangedAction);
	}

	@Override
	public boolean visit(TimeChangedAction timeChangedAction) {
		// TODO Auto-generated method stub
		forwardActionToPlugin(timeChangedAction);
		return true;
	}
	@Override
	public boolean visit(OrientationChangeAction orientationChangeAction){
		forwardActionToPlugin(orientationChangeAction);
		return true;
	}
}
